<!--
 * @Date: 2022-07-04 15:39:41
 * @LastEditTime: 2022-07-12 22:51:58
-->
<template>
  <div class="com-main">
    <div class="com-left">
      <router-link :to="{path: '/movie/' + comment.video.videoId}">
         <img :src="require('@/assets/img/' + comment.video.videoId + '.jpg')" alt="影报" class="com-movie-img">
      </router-link>
    </div>
    <div class="com-right">
      <div class="com-user">
        <router-link :to="{path: '/user/' + comment.user.uid}">
          <img :src="require('@/assets/img/' + comment.user.uid + '.jpg')" alt="" class="com-user-img">
        </router-link>
        <div class="com-user-nickname">
          <router-link :to="{path: '/user/' + comment.user.uid}">{{comment.user.nickname}}</router-link>
        </div>
        <el-rate
          class="com-user-score"
          v-model="comment.user_score"
          disabled
          text-color="#ff9900"
        >
        </el-rate>
        <div class="com-time">{{comment.comm_time}}</div>
      </div>
      <div class="com-content">
        <p>
          {{comment.user_comm}}
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CommentItem',
  props: ['comment'],
  mounted: function () {
    // console.log(this.comment)
    this.comment.user_score = Number(this.comment.user_score)
  }
}
</script>

<style>
.com-main {
  width: calc(100% - 10px);
  height: calc(100% - 40px);
  padding: 20px 10px 20px 0;
  display: flex;
}
.com-left {
  height: 100%;
  width: 20%;
}
.com-movie-img {
  height: 100%;
}
.com-right {
  width: 80%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.com-user {
  display: flex;
  height: 30px;
  line-height: 30px;
}
.com-user-img {
  width: 30px;
  height: 30px;
}
.com-user-score {
  height: 30px;
  margin-left: 10px;
}
.com-user-score .el-rate__icon{
  margin: 0;
  font-size: 13px;
  line-height: 30px;
}
.com-user-nickname a {
  font-size: 13px;
  color: rgb(51, 119, 189);
  font-weight: 500;
  margin-left: 10px;
}
.com-time {
  font-size: 13px;
  margin-left: 10px;
  color: #aaa;
}
.com-content {
  padding-top: 10px;
  height: calc(100% - 40px);
  max-width: 600px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
